In the conventional axial piston hydraulic pump and motor, by varying the angle of the swash plate, the capacity is varied to obtain various flow rates at the same speed in the case of a hydraulic pump, or to obtain various speeds with the same flow rate in the case of a hydraulic motor. However, in the hydraulic pump and motor, only tilting motions have to be carried out within a certain angular range in accordance with the rotations of a cylinder block and a piston block without rotation of the swash plate. Therefore, in order to prevent rotation of the swash plate, the swash plate has a trunnion in which a tilting shaft is connected to the center of the swash plate, or the swash plate and the both sides of the bottom are provided in a half cylindrical shaped form, thereby providing a cradle type. Such forms have a problem of complicated structure, and therefore, the machining task is difficult, while they are problematic in view of the compactness.